<!doctype html>
<html xmlns:th="http://www.thymeleaf.org"  xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
<div th:include="comm/head :: index_resource"></div>

<body class="layui-layout-body">
<div class="layui-layout layui-layout-admin">
  <!-- 顶部 -->
  <div class="layui-header">
    <div class="logo">
      <a href="javascript:;" onclick="$('.layui-tab-title .home').eq(0).click();">
        <img th:src="@{/layuiadmin/images/logo.png}" class="layui-nav-img">
        <span class="layui-hide-xs">SPRINGBOOT-AUTH</span>
      </a>
    </div>

    <ul class="layui-nav right">
      <li class="layui-nav-item layui-hide-xs" lay-unselect><a href="javascript:;" hg-event="fullscreen" title="全屏"><i
              class="fa fa-arrows-alt fa-lg"></i></a></li>
      <li class="layui-nav-item layui-hide-xs" lay-unselect><a href="javascript:;" onclick="cleancache()" hg-event="delSkinConfig" title="清除缓存"><i
              class="fa fa-trash-o fa-lg"></i></a></li>
      <li class="layui-nav-item">
        <a href="javascript:;">
          <img th:src="${userFace}" class="layui-nav-img" onerror="javascript:this.src='layuiadmin/images/touxiang.jpg'">
          <span><shiro:principal property="uname"/></span></a>
        <dl class="layui-nav-child">
          <dd lay-unselect><a onclick="hg.add_tab('修改密码','goUpdatePwd')"><i
                  class="fa fa-pencil-square fa-fw"></i>修改密码</a></dd>
          <dd lay-unselect><a th:href="@{/logout}"><i class="fa fa-sign-out fa-fw"></i>退出</a></dd>
        </dl>
      </li>
    </ul>
  </div>

  <!-- 左侧菜单 -->
  <div class="layui-left-nav scrollBox">
    <div id="side-nav">
      <ul id="nav" class="layui-tab-item layui-show">
        <li class="open" th:each="menu:${menuList}">
          <shiro:hasPermission name="${menu.id}">
            <a class="border active">
              <i class="fa fa-cog fa-fw"></i>
              <cite th:text="${menu.name}">菜单</cite>
              <i class="fa fa-angle-up fa-fw nav_right"></i>
            </a>
            <ul class="sub-menu" style="display: block;" th:each="child:${menu.childList}">
              <shiro:hasPermission name="${child.id}">
              <li class="sub-tab" th:attr="hg-title=${child.name},hg-nav=${child.url}">
                <a><i class="fa fa-tag fa-fw"></i><cite th:text="${child.name}">菜单</cite></a>
              </li>
              </shiro:hasPermission>
            </ul>
          </shiro:hasPermission>
        </li>
      </ul>
    </div>
  </div>

  <!-- 内容 -->
  <div class="layui-page-content">
    <div class="layui-tab tab" lay-unauto lay-allowClose="true" lay-filter="xbs_tab">
      <span class="indent-tab left" title="侧边伸缩"><i class="fa fa-dedent fa-lg"></i></span>
      <div class="indent-tab left fa fa-step-backward fa-fw"></div>
      <ul class="layui-nav">
        <li class="layui-nav-item">
          <a href="javascript:;"><i class="fa fa-dot-circle-o fa-fw"></i> 页面操作</a>
          <dl class="layui-nav-child">
            <dd lay-unselect data-page-close="this">
              <a href="javascript:;"><i class="fa fa-refresh fa-fw"></i> 刷新当前</a>
            </dd>
            <dd lay-unselect data-page-close="other">
              <a href="javascript:;"><i class="fa fa-ban fa-fw"></i> 关闭其他</a>
            </dd>
            <dd lay-unselect data-page-close="all">
              <a href="javascript:;"><i class="fa fa-power-off fa-fw"></i> 关闭全部</a>
            </dd>
          </dl>
        </li>
      </ul>
      <div class="indent-tab right fa fa-step-forward fa-fw"></div>
        <ul class="layui-tab-title">
          <li class="home layui-this"><i class="fa fa-home fa-fw"></i></li>
        </ul>

        <div class="layui-tab-content">
          <div class="layui-tab-item layui-show">
            <iframe src='census/goHome' frameborder="0" scrolling="yes" class="hg-iframe"></iframe>
          </div>
        </div>
    </div>
  </div>

</div>
<script>
  function cleancache(){
    var a = hg.load(function(){
      var that = this;
      setTimeout(function(){
        //that.close(); //关闭加载层
        a.close();
        hg.msghide('清除服务器缓存成功.');
      },2000);
    })
  }
</script>
</body>
</html>